-
Notifications
You must be signed in to change notification settings - Fork 115
Fix for Boost >= 1.87 #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
The failure that's happening with Ubuntu + Boost 1.70 might be expected: boostorg/thread#297. I think you'll see that with any version of Boost between 1.69 and 1.72. Some of the macOS errors are caused by an incompatibility with Clang that was fixed in Boost 1.81: boostorg/numeric_conversion@50a1eae |
|
Anecdotally, I can say that I also haven't had any issues with these changes on Windows 11 with Boost 1.89. The only problem I've had, which is an existing issue in the master branch, is that the async functions added in #195 don't compile when using some newer Asio completion token types. For example, It looks like Asio's async operations now use the return type of template<class CompletionToken, class ConstBufferSequence>
auto async_send(azmq::socket &socket, ConstBufferSequence const &buffers, CompletionToken &&token)
-> decltype(
boost::asio::async_initiate<CompletionToken, void(boost::system::error_code, size_t)>(
std::declval<async_send_initiation<ConstBufferSequence>>(), token))I don't know if this necessarily needs to be fixed in this PR, but it's worth noting. |
|
The branch was getting too polluted with my attempts at making it work for all versions so I cleaned it up a little.
I've given up on getting it to work for 1.70 because of the issues commented by @cbrl. The point of the PR is not to fix Boost, so I guess that's something we can live with. One of the breaking changes is the deprecation of A simple solution is to use: # OLD behavior is to use the FindBoost module from cmake
# NEW behavior is to use the Boost CMake provided config files
# Boost 1.70 and above can use the new behavior
if (POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()This however will make all builds for Boost < 1.70 fail. Currently I'm manually specifying in the tests which version of the Policy to use with The policy does specify that in future versions of cmake the |
@cbrl Should we then test on macOS only from 1.81 onwards? |
Probably. That specific error I linked to happens in Clang 16+, so only starting with macOS 15. However, macOS versions <15 still have other various compile errors in earlier versions of the Boost libraries. |
As mentioned in issue #216 some deprecated code has been removed from asio, making builds fail on boost >= 1.87. This is my attempt to fix this and try to improve the GitHub action to test more versions of Boost on each OS. Changes to the GitHub action were required to make sure that my changes remained backwards compatible.
I'm not an expert on what's going on under the hood in azmq but I just went through every part of the code that wasn't building and looked for the recommended alternative. Any feedback is appreciated.
We rely on azmq for some of our projects, so getting this fixed is of great interest to us.
I've removed the actions running on
macos-11,macos-12andubuntu-20.04since those runners have been deprecated. And I've addedmacos-13,macos-14,macos-15andubuntu-24.04to the matrix, since those are the currently supported versions.Some OS/Boost combinations that weren't being tested before still won't build (mostly macOS), so I would appreciate some help with this. I'm not sure how much of a priority this is for you. They could also be added to the exclusion list in the action.
Closes #216